package com.tip.search;

/**
 */
public class InsertParamDTO {

    private Integer id;
    private String  value;

    /**
     */
    public InsertParamDTO(Integer id, String value) {
        this.id = id;
        this.value = value;
        validate();
    }

    public void validate() {
        if (id == null) throw new RuntimeException("id is null;");
        if (value == null) throw new RuntimeException("value is null;");
        if (id <= 0) throw new RuntimeException("id(" + id + ") isn't positive;");
        if (value.length() == 0) throw new RuntimeException("length of the value is zero;");
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }
}
